#!/bin/bash

set -e

cat <<EOF
{
    "ansible_facts": {
        "docker_server_version": "$(docker version -f '{{.Server.Version}}')",
        "docker_client_version": "$(docker version -f '{{.Client.Version}}')",
        "docker_info": $(curl -s --unix-socket /var/run/docker.sock http://:/info),
        "docker_version": $(curl -s --unix-socket /var/run/docker.sock http://:/version),
        "docker_containers": $(curl -s --unix-socket /var/run/docker.sock http://:/containers/json?all=true),
        "docker_images": $(curl -s --unix-socket /var/run/docker.sock http://:/images/json)
    },
    "changed": false
}
EOF

exit 0